package util;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class ConfigurationBean extends Properties{
	private static ConfigurationBean configurationBean;
	
	public static final String ALL_ENTRIES_OUTPUT_KEY = "ALL_ENTRIES_OUTPUT";
	public static final String CSV_STRING_BUSCA_NAME_KEY = "CSV_STRING_BUSCA_NAME";
	public static final String DATA_EXTRACTION_ROOT_PATH_KEY = "DATA_EXTRACTION_ROOT_PATH";
	public static final String DECORAR_PALAVRAS_CHAVES_KEY = "DECORAR_PALAVRAS_CHAVES";
	public static final String WORD_CLOUD_TAG_OUTPUT_KEY = "WORD_CLOUD_TAG_OUTPUT";
	
	
	private ConfigurationBean() {
		try {
			this.load(new FileReader(this.getClass().getClassLoader().getResource("configuration.properties").getFile()));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	

	public static ConfigurationBean getInstance() {
		if(configurationBean == null){
			configurationBean = new ConfigurationBean();
		}

		return configurationBean;
	}
	
	@Override
	public synchronized String get(Object key) {
		return (String) super.get(key);
	}
	
	@Override
	public synchronized String setProperty(String key, String value) {
		return (String) super.setProperty(key, value);
	}
	
}
